﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;

namespace YXShop.Web.admin.include
{
    public partial class memberlist_ajax : System.Web.UI.Page
    {
        YXShop.BLL.Member.MemberAccount bll = new YXShop.BLL.Member.MemberAccount();
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                Response.CacheControl = "no-cache";
                Response.Expires = 0;
                ProList.InnerHtml = MemberList();
            }
        }

        private string MemberList()
        {
            ChangeHope.WebPage.Table table = new ChangeHope.WebPage.Table();
            ChangeHope.DataBase.DataByPage dataPage = bll.GetList(" and State=0 ");
            table.AddHeadCol("","会员ID");
            table.AddHeadCol("","会员名称");
            table.AddRow();
            if(dataPage.DataReader!=null)
            {
                while(dataPage.DataReader.Read())
                {
                    table.AddCol(dataPage.DataReader["UID"].ToString());
                    table.AddCol("<span id=\"" + dataPage.DataReader["UID"].ToString() + "\" class=\"LableItem\"  onClick=\"SelectLable(this);sFiles('" + dataPage.DataReader["UID"].ToString() + "','" + dataPage.DataReader["UserId"] + "');\">" + dataPage.DataReader["UserId"] + "</span>");
                   // table.AddCol(dataPage.DataReader["UserId"].ToString());
                    //"<span id=\"" + dataPage.DataReader["UID"].ToString() + "\" class=\"LableItem\" ondblclick=\"ReturnValue();\" onClick=\"SelectLable(this);sFiles('" + dataPage.DataReader["UID"].ToString() + "','" + dataPage.DataReader["UserId"] + "');\">" + dataPage.DataReader["UserId"] + "</span>";
                    table.AddRow();
                }
            }
            string view = table.GetTable() + dataPage.PageToolBar;
            dataPage.Dispose();
            dataPage = null;
            return view;
        }
    }
}
